package cc.comac.mom.service.impl.config;

import cc.comac.mom.api.config.EquipConnectConfigService;
import cc.comac.mom.bean.config.EquipConnectConfigBean;
import cc.comac.mom.bean.config.EquipConnectConfigParamBean;
import cc.comac.mom.datahandlers.entity.config.EquipConnectConfigDataHandler;
import cc.comac.mom.entity.config.EquipConnectConfigEntity;
import cc.comac.mom.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Service
@RestController
public class EquipConnectConfigServiceImpl implements EquipConnectConfigService {

	@Autowired
	private EquipConnectConfigDataHandler equipConnectConfigDataHandler;

	@Autowired
	private StringRedisTemplate stringRedisTemplate;

	@Override
	public ResultBean save(@RequestBody EquipConnectConfigBean obj) {
		return equipConnectConfigDataHandler.saveConnectConfig(obj);
	}

	@Override
	public ResultBean update(@RequestBody EquipConnectConfigBean obj) {
		return equipConnectConfigDataHandler.updateConnectConfig(obj);
	}

	@Override
	public ResultBean delete(@RequestBody EquipConnectConfigEntity obj) {
		return equipConnectConfigDataHandler.delete(obj);
	}
	@Override
	public ResultBean getById(@RequestBody EquipConnectConfigEntity obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject(equipConnectConfigDataHandler.getById(obj.getId()));
		return resultBean;

	}
	@Override
	public ResultBean selectByCondition(@RequestBody EquipConnectConfigParamBean obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject( equipConnectConfigDataHandler.selectBySomeFields(obj));
		return resultBean;
	}

}
